package com.encyclopedia.controller;


import com.encyclopedia.entity.Cultivation;
import com.encyclopedia.service.CultivationService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author MaLiang
 * @version 1.0
 * @date 2024-04-22 8:52
 * 种植信息
 */
@RestController
@RequestMapping("/plant/cultivation")
public class CultivationController {

    @Autowired
    private CultivationService cultivationService;

    /**
     * 根据植物信息id获取种植信息
     * @param plantId
     * @return
     */
    @GetMapping("/plantId")
    public Cultivation getInfo(@Param("plantId") Integer plantId)
    {
        return cultivationService.getCultivationById(plantId);
    }

}
